-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUGFIX: Prevent warnings for unrecognized DOM props #3895
base: 8.3
Are you sure you want to change the base?
Conversation
This change addresses React warnings related to invalid DOM attributes: - Removed `executeCommand` and `formattingUnderCursor` from being passed to DOM elements. - Ensured these props are only handled within components where they are relevant, preventing them from being incorrectly rendered on DOM elements. These update prevent unnecessary warnings in the console. Resolves: neos#3894
@@ -41,6 +41,11 @@ export default richtextToolbarRegistry => { | |||
[callbackPropName]: e => e.stopPropagation() || executeCommand(commandName, ...commandArgs) | |||
}; | |||
|
|||
// filter out props that are not needed by the component and lead to a render warning | |||
if (commandName === 'code') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why does this have to be conditionally wrapped? And what does code
mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The component that is used for the code command (class U) is not using the two props, and they end up in the DOM and that leads to the issue. In other places, we also omit properties to prevent that they end up in the IconButtons of the toolbar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean the "code" Dom element specifically or some CK internal thing?
If it's a CK internal, a reference in the comment would be great. Like this it just looks like a random magic string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting type code comes from CKEditor and we just pass thru the props to the components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually use just code. But the newer CKEditor also has codeBlock
, but we just don`t have it yet.
This change addresses React warnings related to invalid DOM attributes:
executeCommand
andformattingUnderCursor
from being passed to DOM elements.These update prevent unnecessary warnings in the console.
Resolves: #3894